<template>
	<view class="">
		<view class="shoping-cart">
			<view class="list" v-for="i in 3" :key="i">
				<view class="app-pages">
					<view class="list-title">
						<view class="list-left">
							<u-checkbox-group>
								<u-checkbox v-model="checked" activeColor="#f74062" shape="circle" label=" " value="1">
								</u-checkbox>
							</u-checkbox-group>
						</view>
						<view class="list-right">门店名称</view>
					</view>
					<view class="list-content">
						<view class="list-content-item" v-for="o in 3" :key="o">
							<view class="list-left">
								<u-checkbox-group>
									<u-checkbox v-model="checked" activeColor="#f74062" shape="circle" label=" "
										value="1"></u-checkbox>
								</u-checkbox-group>
							</view>
							<view class="list-right">
								<view class="list-right-col1" width="144rpx" height="144rpx">
									<u--image :showLoading="true" radius="10rpx"
										src="https://p.qqan.com/up/2022-6/16543432417971617.jpg" width="144rpx"
										height="144rpx"></u--image>
								</view>
								<view class="list-right-col2">
									<view class="name">摩卡咖啡</view>
									<view class="introduccion">介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍</view>
									<view class="app-pirce-color">￥20.00</view>
								</view>
								<view class="list-right-col3">
									<view class="list-right-col3-view">
										<u-icon name="minus" color="#333" size="26rpx" @click="numb++"></u-icon>
										<text>{{numb}}</text>
										<u-icon name="plus" color="#333" size="26rpx" @click="numb--"></u-icon>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>

			<!-- 底部按钮 -->
			<view class="btn app-pages">
				<view class="btn-left">
					<u-checkbox-group>
						<u-checkbox v-model="checked" activeColor="#f74062" shape="circle" label="全选" value="1">
						</u-checkbox>
					</u-checkbox-group>
				</view>
				<view class="btn-right">
					<text>总计：</text>
					<text style="font-weight: bold;">￥186</text>
					<view class="button">
						<view class="submit" @click="handleRouter('/homePages/orderSubmit/index')">去结算</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'ShopingCart',
		data() {
			return {
				title: '',
				content: '',
				checked: [],
				numb: 0
			}
		},
		onShow() {
			if (typeof this.$scope.getTabBar === 'function' && this.$scope.getTabBar()) {
				this.$scope.getTabBar().setData({
					selected: 2
				})
			};
		},
		methods:{
			handleRouter(url) {
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.shoping-cart {
		padding-bottom: calc(120rpx + 120rpx + 10rpx + env(safe-area-inset-bottom));

		.btn {
			position: fixed;
			left: 0;
			right: 0;
			bottom: calc(110rpx + env(safe-area-inset-bottom));
			height: 120rpx;
			display: flex;
			align-items: center;
			background-color: #FFFFFF;

			.btn-right {
				flex: 1;
				display: flex;
				justify-content: flex-end;
				align-items: center;
				font-size: $uni-font-size-sm;
			}

			.button {
				width: 140rpx;
				padding-left: 30rpx;
				.submit{
					padding: 15rpx 35rpx;
					border-radius: 4rpx;
					color: #FFFFFF;
					background-color: #f74062;
				}
			}

			.btn-left {
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}

		.list {
			.app-pages {
				border-bottom: 4rpx solid #f2f2f2;
				padding-bottom: 30rpx;
			}

			&:nth-last-child(1) {
				.app-pages {
					border-color: transparent;
				}
			}

			.list-right-col3 {
				display: flex;
				align-items: flex-end;
				flex: 1;

				.list-right-col3-view {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: space-between;
				}
			}

			.list-right-col2 {
				font-size: $uni-font-size-sm;
				width: 320rpx;
				padding: 0 15rpx;

				.name {
					white-space: nowrap;
					word-break: break-all;
					text-overflow: ellipsis;
				}

				.introduccion {
					display: -webkit-box;
					overflow: hidden;
					white-space: normal !important;
					text-overflow: ellipsis;
					word-wrap: break-word;
					-webkit-line-clamp: 2; //行数
					-webkit-box-orient: vertical;
					margin: 8rpx 0;
				}
			}

			.list-title {
				padding: 30rpx 0;
			}

			.list-content-item {
				.list-right {
					display: flex;
					flex: 1;
					border-bottom: 2rpx solid #f2f2f2;
					padding: 20rpx 0;
				}

				&:nth-child(1) {
					.list-right {
						padding-top: 0;
					}
				}

				&:nth-last-child(1) {
					.list-right {
						border-color: transparent;
						padding-bottom: 0;
					}
				}
			}

			.list-content-item,
			.list-title {
				display: flex;
				align-items: center;

				.list-left {
					padding-right: 30rpx;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}
</style>
